<template>
  <div>
    <button @click="isShow=!isShow">显示/隐藏</button>
    <transition appear>
       <h1 v-show="isShow" >你好</h1>
    <transition/>
  </div>
  
</template>

<script>
export default {
  name: "",
  data() {
    return {
      isShow: true,
    };
  },
};
</script>

<style scoped>
h1 {
  background-color: orange;
}
.v-enter-active {
  animation: identifier 1s;
}
.v-leave-active {
  animation: identifier 1s;
}
@keyframes identifier {
  from {
    transform: translateX(-100px);
  }
  to {
    transform: translateX(0px);
  }
}
</style>